package test.db.table.mysql.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwPostTable implements Table, ColumnType {
    ZIPCODE(Column.zipcode),
    SEQ(Column.seq),
    SIDO(Column.sido),
    SIGUNGU(Column.sigungu),
    DONG(Column.dong),
    RE(Column.re),
    DOSEO(Column.doseo),
    SANBUNJI(Column.sanbunji),
    START_BUNJI_PRIMARY(Column.startBunjiPrimary),
    START_BUNJI_SECONDARY(Column.startBunjiSecondary),
    END_BUNJI_PRIMARY(Column.endBunjiPrimary),
    END_BUNJI_SECONDARY(Column.endBunjiSecondary),
    APARTMENT(Column.apartment),
    DONG_RANGE_START(Column.dongRangeStart),
    DONG_RANGE_END(Column.dongRangeEnd),
    MODIFY_DATE(Column.modifyDate),
    ADDRESS(Column.address);

    private final Column column;

    private static final String TYPE_ZIPCODE = "VARCHAR(6)";
    private static final String TYPE_SEQ = "VARCHAR(3)";
    private static final String TYPE_SIDO = "VARCHAR(20)";
    private static final String TYPE_SIGUNGU = "VARCHAR(20)";
    private static final String TYPE_DONG = "VARCHAR(20)";
    private static final String TYPE_RE = "VARCHAR(100)";
    private static final String TYPE_DOSEO = "VARCHAR(100)";
    private static final String TYPE_SANBUNJI = "VARCHAR(20)";
    private static final String TYPE_START_BUNJI_PRIMARY = "VARCHAR(10)";
    private static final String TYPE_START_BUNJI_SECONDARY = "VARCHAR(10)";
    private static final String TYPE_END_BUNJI_PRIMARY = "VARCHAR(10)";
    private static final String TYPE_END_BUNJI_SECONDARY = "VARCHAR(10)";
    private static final String TYPE_APARTMENT = "VARCHAR(50)";
    private static final String TYPE_DONG_RANGE_START = "VARCHAR(10)";
    private static final String TYPE_DONG_RANGE_END = "VARCHAR(10)";
    private static final String TYPE_ADDRESS = "VARCHAR(255)";

    PwPostTable(Column column) {
        this.column = column;
    }

    private enum Column {
        zipcode {
            String getType() {
                return TYPE_ZIPCODE;
            }
        },
        
        seq {
            String getType() {
                return TYPE_SEQ;
            }
        },
        
        sido {
            String getType() {
                return TYPE_SIDO;
            }
        },
        
        sigungu {
            String getType() {
                return TYPE_SIGUNGU;
            }
        },
        
        dong {
            String getType() {
                return TYPE_DONG;
            }
        },
        
        re {
            String getType() {
                return TYPE_RE;
            }
        },
        
        doseo {
            String getType() {
                return TYPE_DOSEO;
            }
        },
        
        sanbunji {
            String getType() {
                return TYPE_SANBUNJI;
            }
        },
        
        startBunjiPrimary {
            String getType() {
                return TYPE_START_BUNJI_PRIMARY;
            }
        },
        
        startBunjiSecondary {
            String getType() {
                return TYPE_START_BUNJI_SECONDARY;
            }
        },
        
        endBunjiPrimary {
            String getType() {
                return TYPE_END_BUNJI_PRIMARY;
            }
        },
        
        endBunjiSecondary {
            String getType() {
                return TYPE_END_BUNJI_SECONDARY;
            }
        },
        
        apartment {
            String getType() {
                return TYPE_APARTMENT;
            }
        },
        
        dongRangeStart {
            String getType() {
                return TYPE_DONG_RANGE_START;
            }
        },
        
        dongRangeEnd {
            String getType() {
                return TYPE_DONG_RANGE_END;
            }
        },
        
        modifyDate {
            String getType() {
                return TYPE_MODIFY_DATE;
            }
        },
        
        address {
            String getType() {
                return TYPE_ADDRESS;
            }
        };

        abstract String getType();
    }

    public String getType() {
        return column.getType();
    }

    public void initData() throws Exception {
    }
}